1. Field of the Invention
This invention relates generally to control apparatus for controlling the operation of vending machines, and particularly to such control apparatus having an improved detection and decoding arrangement for detecting the operation of vending machine switches, such as product selection switches, a coin return switch or any other vending machine operation controlling or detecting switch typically found in a vending machine.
2. Description of the Prior Art
Many vending machines employ a control circuit including a programmed microprocessor or microcomputer for purposes of controlling their operation. See, for example, the disclosure of U.S. Pat. No. 4,458,187 which is assigned to the assignee of the present invention and which is incorporated herein by reference. During the operation of such control circuits, it is necessary to detect and decode the closing of a number of switches as a result of a customer's usage of the vending machine or the resultant operation of the vending machine in response to the customer's usage. For example, when a customer wishes to select an item in a vending machine, he typically inserts coins equal to or exceeding the price of the item and then presses one or more selection buttons corresponding to the item. The vending machine compares the customer's credit with the price of the item selected, and if the credit is equal to or greater than the price, causes a dispensing means, such as a vend motor, to cause the selected item to be dispensed to the customer. If the customer's credit exceeded the price of the item, the difference is typically returned to the customer from a supply of coins maintained in the vending machine for purposes of making change.
Switches either are or may be employed in a large variety of the above operations. By way of example, switches may be involved in the detection and crediting of the customer's insertion of coins into the vending machine. When a customer operates a selection button, a corresponding selection switch is closed. Switches may be employed to detect the operation of a vend motor, to determine if a vend motor is operating properly, to ascertain if a product is sold out or to ascertain that a product has been delivered to the customer. Additional switches may be used to monitor the supply of change coins or to monitor the actual delivery of change to the customer. In order to function, a vending machine must be able to detect the closure of any of the above switches which it employs, and to identify which switch has closed once closure is detected.
By way of example, a number of prior art arrangements are known for detecting and decoding the selector switches of a vending machine. U.S. Pat. No. 4,593,361 shows a capacitive touch panel including eight capacitive touch switches each of which is connected to a corresponding input of a shift register. Serial data from this shift register is entered into a second shift register before being transferred to a central processor. A selection switch subroutine determines if a vend selection has been made.
U.S. Pat. No. 4,354,613 describes a selection switch arrangement in which one selection switch is provided for each item to be vended. A plurality of selection buttons corresponding to the selection switches are arranged in rows and columns. A line for each row and a line for each column is used in decoding a selection button which has been actuated. Similarly, U.S. Pat. Nos. 4,233,660 and 4,225,056 describe a keyboard matrix of product selection push-button switches which are sequentially interrogated by a control microprocessor by sequential energization and interrogation of row and column lines. U.S. Pat. No. 4,231,105 also illustrates a matrix arrangement of selection switches and price setting switches.
It is seen that a variety of keyboard decoding systems have been put to use in the vending field over the years. The cost effectiveness of any keyboard decoding system is dependent on several parameters including: the cost of the keypad or switches employed; the number of lines required to decode the number of switches employed; the cost of the support hardware to decode the switches; the number of lines required by the decode hardware to output the decoded switch data; and the physical size of the decode hardware. The prior art relating to vending describes various schemes to optimize one or two of the elements listed above, but none is optimal from the point of view of all five listed parameters. This is true despite the fact that a wide variety of keyboards and keypads have long been available from manufacturers of such items.
For example, for decoding a number of keys M, keyboards and keypads are available that provide a common line to the M keys to be decoded and a separate line to each of the M keys. Thus, this decoding arrangement has M+1 lines to the keyboard. The decode hardware consequently requires M input lines (the one per key) and typically will have a binary output which requires log.sub.2 M (rounded up to the nearest whole number) lines out. The costs of a binary decoder, the input/output (I/O) lines to the processing device, and the required physical space for these components are high.
Keyboards which use fewer lines to control more keys are also available. An example is a matrix construction in which the depression of a key switch causes two outputs, one representing the row of the switch and one representing the column of the switch. The number of required lines to the keyboard therefore is X+Y where X represents the number of rows of key switches and Y represents the number of columns of key switches. The total number of lines X+Y can be significantly less than the number of lines required in the scheme described in the immediately preceding paragraph. The total number of lines, however, will be a function of the setup of the matrix. In other words, a 4.times.4 matrix will have 16 switches, as will an 8.times.2 matrix of switches; however, the first scheme uses 8 decode lines, and the latter uses 10 lines. While a matrix arrangement has obvious benefits, the number of lines required by its decode hardware is typically very high and therefore costly.
Other keyboard arrangements have an encoded output such as that in a 2 of N decode arrangement. In this decode scheme, each switch depression results in three contacts being made. One of these contacts is always grounded. The other two contacts are only grounded when the switch is depressed. The output lines therefore give two lines low in addition to the ground line for each switch depression. The number of switches M which can be decoded using N lines plus a common line in this scheme is M=(N)(N-1)/2. Thus, with 7 lines and 1 common line, 21 switches can be decoded ##EQU1## or, in other words, 7 lines in combination of 2 is (7.times.6)/2=21 switches which can be decoded allowing for one common line. This scheme has advantages over the previously described schemes, but it still requires a significant number of lines in the decode hardware used to decode the switches, and requires relatively expensive switches.
Finally, a variety of switch decoding arrangements making use of resistive or capacitive networks so that switch decoding can be achieved with a reduced number of lines have been described in nonvending contexts. See, for example, U.S. Pat. Nos. 4,015,254, 4,415,781, 4,429,301 and 4,495,485.